package com.example.carefree_server.controller.c_studentController;

import com.example.carefree_server.entity.Activity;
import com.example.carefree_server.service.s_studentService.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin(origins = "http://localhost:5173")
@RequestMapping("/findActivity")
public class activityController {
    @Autowired
    private ActivityService activityService;

    @GetMapping("/ById")
    public List<Activity> findActivityById(String sid) {
        return  activityService.findActivityById(sid);
    }

    @GetMapping("/ByType")
    public List<Activity> findActivitiesByClassification(String sid,String type){
        return  activityService.findActivitiesByType(sid,type);
    }

    @GetMapping("/ByTypes")
    public List<Activity> findActivitiesByClassification(String sid,String type,String types){
        return  activityService.findActivitiesByTypes(sid,type,types);
    }

    @GetMapping("/findAll")
    public List<Activity> findAllActivity() {
        return  activityService.findAllActivity();
    }


}
